package com.molyfun.parents.activity.setting;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.molyfun.parents.R;
import com.molyfun.parents.activity.common.BaseActivity;
import com.molyfun.parents.view.common.MfEditText;

import butterknife.ButterKnife;
import butterknife.InjectView;

public class BindAlipayActivity extends BaseActivity implements View.OnClickListener {

    @InjectView(R.id.base_title_left)
    ImageView mTitleLeft;
    @InjectView(R.id.base_title)
    TextView mTitle;
    @InjectView(R.id.alipayid)
    MfEditText mAliPayId;
    @InjectView(R.id.commit)
    Button mCommit;


    public static void startActivity(Context context){
        Intent intent = new Intent();
        intent.setClass(context, BindAlipayActivity.class);
        context.startActivity(intent);
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bind_alipay);
        ButterKnife.inject(this);
        getSupportActionBar().setTitle("");
        mTitle.setText("绑定支付宝");
        mTitleLeft.setOnClickListener(this);
        mCommit.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.base_title_left:
                finish();
                break;
            case R.id.commit:
                uploadRealNameInfo();
                break;
        }
    }

    private void uploadRealNameInfo(){
        if(TextUtils.isEmpty(mAliPayId.getText().toString().trim())){
            toast("请输入支付宝账号");
            return;
        }

    }

//    private void cancelOrder(String orderId) {
//        Call<BaseResponse> call = MFPApplication.getInstance().getRestClient().cancelOrder(orderId);
//        call.enqueue(new Callback<BaseResponse>() {
//            @Override
//            public void onResponse(Call<BaseResponse> call, Response<BaseResponse> response) {
//                dismissProgressDialog();
//                if (response.body() != null && response.body().getCode() == 200) {
//                    toast("取消成功");
//                } else {
//                    toast("取消失败" + (response.body() == null ? "" : response.body().getMsg()));
//                }
//
//            }
//
//            @Override
//            public void onFailure(Call<BaseResponse> call, Throwable t) {
//                dismissProgressDialog();
//            }
//        });
//
//    }


}
